package trial;

public class Thr implements Runnable {

    protected int countDown = 5;
    private static int taskCount = 0;
    private final int id = taskCount++;

    public Thr(int countDown) {
        this.countDown = countDown;
    }

    public Thr() {
    }

    public String status() {
        return "Thread #" + id + " runs:(" + (countDown > 0 ? countDown : "LiftOff thread!") + id + ")";
    }

    @Override
    public void run() {
        while (countDown-- > 0) {
            System.out.print(status());
        }

    }
}
